import service from '@/utils/request'
// @Tags Category
// @Summary 创建liCategory表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Category true "创建liCategory表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /category/createCategory [post]
export const createCategory = (data) => {
  return service({
    url: '/category/createCategory',
    method: 'post',
    data,
  })
}

// @Tags Category
// @Summary 删除liCategory表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Category true "删除liCategory表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /category/deleteCategory [delete]
export const deleteCategory = (data) => {
  return service({
    url: '/category/deleteCategory',
    method: 'post',
    data,
  })
}

// @Tags Category
// @Summary 更新liCategory表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Category true "更新liCategory表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Router /category/updateCategory [put]
export const updateCategory = (data) => {
  return service({
    url: '/category/updateCategory',
    method: 'put',
    data,
  })
}

// @Tags Category
// @Summary 用id查询liCategory表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query model.Category true "用id查询liCategory表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /category/findCategoryById [get]
export const findCategoryById = (params) => {
  return service({
    url: '/category/findCategoryById',
    method: 'get',
    params,
  })
}

// @Tags Category
// @Summary 获取所有Category分类列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query request.PageInfo true "获取所有Category分类列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /category/GetAllCategoriesInfo [get]
export const GetAllCategoriesInfo = (params) => {
  return service({
    url: '/category/GetAllCategoriesInfo',
    method: 'get',
    params,
  })
}
// @Tags Category
// @Summary 不需要鉴权的liCategory表接口
// @accept application/json
// @Produce application/json
// @Param data query request.CategorySearch true "分页获取liCategory表列表"
// @Success 200 {object} response.Response{data=object,msg=string} "获取成功"
// @Router /category/getCategoryPublic [get]
export const getCategoryPublic = () => {
  return service({
    url: '/category/getCategoryPublic',
    method: 'get',
  })
}
